package com.xjm.controller.superadmin;

import com.xjm.model.bo.ShopCategory;
import com.xjm.model.dto.Result;
import com.xjm.model.vo.Page;
import com.xjm.service.solo.ShopCategoryService;
import org.myspringframework.core.annotation.Controller;
import org.myspringframework.core.inject.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author jaymin<br>
 * 管理店铺类别<br>
 * 2020/11/7 22:56
 */
@Controller
public class ShopCategoryController {

    @Autowired
    private ShopCategoryService shopCategoryService;

    /**
     * @param request
     * @param response
     * @return
     */
    public Result<Boolean> addShopCategory(HttpServletRequest request, HttpServletResponse response) {
        return shopCategoryService.addShopCategory(null);
    }

    /**
     * @param request
     * @param response
     * @return
     */
    public Result<Boolean> deleteShopCategory(HttpServletRequest request, HttpServletResponse response) {
        return shopCategoryService.deleteShopCategory(0);
    }


    /**
     * @param request
     * @param response
     * @return
     */
    public Result<Boolean> updateShopCategory(HttpServletRequest request, HttpServletResponse response) {
        return shopCategoryService.updateShopCategory(null);
    }

    /**
     * @param request
     * @param response
     * @return
     */
    public Result<ShopCategory> getShopCategoryById(HttpServletRequest request, HttpServletResponse response) {
        return shopCategoryService.getShopCategoryById(0);
    }

    /**
     * @param request
     * @param response
     * @return
     */
    public Result<List<ShopCategory>> getShopCategoryList(HttpServletRequest request, HttpServletResponse response) {
        return shopCategoryService.getShopCategoryList(null, null);
    }
}
